package com.szt.sy.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.stereotype.Component;

import com.szt.sy.config.ApplicationConfig;

/***
 * 初始listener，设置一些基本信息
 * 
 * @author wwy
 *
 */
@Component
public class InitListener implements ServletContextInitializer {
	
	@Autowired
	private ApplicationConfig applicationConfig;
	
	@Override
	public void onStartup(ServletContext servletContext) throws ServletException {
		servletContext.setAttribute("sysName", applicationConfig.getName());
	}
	
}
